package cn.itsource.pethome.user.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class itsourceWebMvcConfigurer implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //拦截器注册
       /* registry.addInterceptor(loginInterceptor)
                //拦截所有请求
                .addPathPatterns("/**")
                //不拦截登录
                .excludePathPatterns("/user/login")
                //放行微信扫码
                .excludePathPatterns("/wechat/toLogin")

                //不拦截后台用户登录
                .excludePathPatterns("/employee/login")
                //不拦截登录
                .excludePathPatterns("/user/loginByCode")
                //不拦截注册
                .excludePathPatterns("/user/register")
                //不拦截获取注册验证码
                .excludePathPatterns("/code/verificationcode")
                //不拦截获取登录验证码
                .excludePathPatterns("/code/verificationPhoneCode")
                //不拦截手机号是否被注册请求
                .excludePathPatterns("/user/checkPhone");*/
    }
}
